package voxietest1.jam;

import voxbox.wrapper.VoxiScene;

public class PongScene extends VoxiScene {
	public PongScene() {
	}

	Paddle[] paddles = new Paddle[2]; 
	Ball ball;
	World world;
	
	// z = {-.6, .6}
	
	public void mySetup() {
		world = new World();
		ball = new Ball(world, 0,0,0);
		ball.RestartBall();
		paddles[0] = new Paddle(world, 0,0,-.60f);
		paddles[1] = new Paddle(world, 0,0,.60f);
	}

	public void myUpdate() {
		ball.myUpdate();
		paddles[0].Move(-scene.mouseDX/500f, -scene.mouseDY/500f);
		paddles[1].Move(-scene.mouseDX/500f, -scene.mouseDY/500f);
	}

	
	
	public void myDrawTwist() {		
		float twist = scene.mouseX/400.0f;
		
		for (int i=0; i < 40; i++) {
			scene.drawBox(0,0,-1+.05f*i, i*twist, .5f, .5f);
		}
	}
	
		
	public void myDraw() {
		for (Paddle p : paddles) {
			scene.drawBox(p.x, p.y, p.z, 0, p.width, p.height);
		}
		
		voxi.voxi_drawsph(scene.frame,  ball.x,  ball.y,  ball.z,  ball.radius,  ball.radius,  7);		
	}


}
